<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>axios  请求参数</title>
</head>
<body>
    <script src="./js/axios.js"></script>
    <script>
        //get请求传入参数
        axios.get('http://localhost:3000/axios?id=1001').then(function(response){
            //response对象中封装了很多响应的相关的数据
            console.log(response.data);
        });

        axios.get('http://localhost:3000/axios/1001').then(function(response){
            //response对象中封装了很多响应的相关的数据
            console.log(response.data);
        });

        axios.get('http://localhost:3000/axios',{
            params:{
                id:1002
            }
        }).then(function(response){
            //response对象中封装了很多响应的相关的数据
            console.log(response.data);
        });

        axios.delete('http://localhost:3000/axios/1003').then(function(response){
            //response对象中封装了很多响应的相关的数据
            console.log(response.data);
        });

        axios.post('http://localhost:3000/axios',{
            name:'好人',
            pwd:'250'
        }).then(function(response){
            //response对象中封装了很多响应的相关的数据
            console.log(response.data);
        });

        axios.put('http://localhost:3000/axios/1004',{
            name:'batman',
            pwd:'250'
        }).then(function(response){
            //response对象中封装了很多响应的相关的数据
            console.log(response.data);
        });

        
    </script>
</body>
</html>